package com.doudou.base.resources.entity.dto.user.account;

import com.doudou.commons.constant.AccountType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * 用户账号的详情添加dto类
 *
 * @author 傻男人
 * @since 2020-05-14
 */
@Data
@ApiModel("用户账号的详情添加dto")
public class UserAccountInfoAddDto implements Serializable {

    private static final long serialVersionUID = 1L;


    /**
     * 登录用户名
     */
    @ApiModelProperty("登录用户名")
    private String loginName;

    /**
     * 手机号码
     */
    @ApiModelProperty("手机号码")
    private String phone;

    /**
     * 电子邮箱
     */
    @ApiModelProperty("电子邮箱")
    private String email;

    /**
     * 密码
     */
    @ApiModelProperty("密码")
    private String password;

    /**
     * 微信openId
     */
    @ApiModelProperty("微信openId")
    private String wecatOpenId;

    /**
     * qq的openId
     */
    @ApiModelProperty("qq的openId")
    private String qqOpenId;

    public UserAccountInfoAddDto(){}

    public UserAccountInfoAddDto(String account, AccountType accountType){
        if(accountType.name().equals("phone")){
            this.phone = account;
        }
        if(accountType.name().equals("wecat")){
            this.wecatOpenId = account;
        }
        if(accountType.name().equals("qq")){
            this.qqOpenId = account;
        }

    }

    public UserAccountInfoAddDto(String wecatOpenId){
        this.wecatOpenId = wecatOpenId;
    }

}